package com.dz.syndata.controller;

import com.dz.syndata.mapper.one.PrimaryDeviceMapper;
import com.dz.syndata.base.BaseController;
import com.dz.syndata.bean.UserVo;
import com.dz.syndata.mapper.two.SecondaryUserMapper;
import com.dz.syndata.page.TableDataInfo;
import com.dz.syndata.service.IDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
    @RequestMapping(value = "/device")
public class UserController extends BaseController {
    @Autowired
    private PrimaryDeviceMapper primaryUserMapper;
    @Autowired
    private SecondaryUserMapper secondaryUserMapper;

    @Autowired
    IDeviceInfoService mDeviceInfoService;
    /**
     *    获取第一个数据库数据
     */
    @RequestMapping("primary")
    public TableDataInfo primary(){
        startPage();
//        List<CarGpsInfo> list = primaryUserMapper.findAll();
//        return getDataTable(list);
        return null;
    }
      /**
     *    获取第二个数据库数据
     */
    @RequestMapping("secondary")
    public Object secondary  (){
//        List<UserVo> list = secondaryUserMapper.findAll();
        return "";
    }
    /**
     *    获取第二个数据库数据
     */
    @RequestMapping("/insert")
    public Object insert  (){
        mDeviceInfoService.insertDeviceData();
        return toAjax(1);
    }
    @RequestMapping("/insertCode")
    public Object insertCode  (){
        mDeviceInfoService.insertDeviceCode();
        return toAjax(1);
    }

}
